﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
    xmlns:Location="clr-namespace:System.Device.Location;assembly=System.Device"
    x:Class="Mapping_Demo.Views.IsMapOffline"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem IsEnabled="True" Text="airplane mode" Click="GoToAirplaneSettings"/>
			</shell:ApplicationBar.MenuItems>
			<!-- shell:ApplicationBarIconButton IconUri="/Assets/AppBar/feature.settings.png" IsEnabled="True" Text="stop"/-->
            <shell:ApplicationBarIconButton IconUri="/Assets/AppBar/download.png" IsEnabled="True" Text="offline map" Click="DownloadOfflineMaps"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>                          

        <!--TitlePanel contains the name of the application and page title-->

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" >
            <maps:Map x:Name="myOfflineMap" 
                      Grid.Row="1" 
                      ZoomLevel="6">
            	<maps:Map.Center>
            		<Location:GeoCoordinate 
                        Altitude="NaN" Course="NaN" HorizontalAccuracy="NaN" Longitude="-78.8541610725224" Latitude="36.4823690056801" Speed="NaN" VerticalAccuracy="NaN"/>
            	</maps:Map.Center>
            </maps:Map>   
			        </Grid>
        <Border BorderBrush="Black" 
				BorderThickness="0" 
				Background="{StaticResource PhoneAccentBrush}" 
				VerticalAlignment="Top" Tap="TopBarTapped" >
        	<StackPanel>
        		<TextBlock x:Name="InstructionalText" TextWrapping="Wrap" Margin="24,12,0,6" FontFamily="Segoe WP Semibold" FontSize="20" Text="tap here to turn off connectivity"/>
        		</StackPanel>
        </Border>               
        <Border BorderThickness="0" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Bottom" Background="{StaticResource PhoneAccentBrush}" Width="156" Height="91">
        	<StackPanel Margin="0" Orientation="Vertical">
        		<TextBlock TextWrapping="Wrap" Text="ZOOM LEVEL" FontFamily="Segoe WP Black" FontSize="13.333" HorizontalAlignment="Center"/>
        		<TextBlock x:Name="zoomElement" 
        			FontFamily="Segoe WP Light" 
        			FontSize="80"    
        			Text="{Binding ZoomLevel, ElementName=myOfflineMap, StringFormat=\{0:F1\}}"                 
        			HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-21,0,0"/>
        	</StackPanel>
					 <!-- Text="{Binding ZoomLevel, ElementName=myOfflineMap, StringFormat=\{0:F1\}}" -->
        </Border>
    </Grid>       

</phone:PhoneApplicationPage>